
/********************************************************************************
** This file contains the declaration of OpenQ10 MainWindow
**
** Created: Thu 29. Nov 16:57:44 2007
**      by: Imran Shahid
**
********************************************************************************/

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

class QCloseEvent;
class QColor;
class QFont;
class QStatusBar;
class QString;
class QWidget;
class TextEdit;
class InfoBar;

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    QWidget *centralwidget;
    TextEdit *textedit;
    InfoBar *infobar;

private:
    QColor *textcolor;
    QColor *backgroundcolor;
    QFont *font;
    QString filename;
    QString appname;
    QAction *actionSave;

public:
    MainWindow();

protected:
    virtual void closeEvent(QCloseEvent *e);

private slots:
    void backgroundColorChanged(QColor *color);
    void fileNew();
    void fileOpen();
    bool fileSave();
    bool fileSaveAs();
    void help();

private:
    void setupUi();
    void setupActions();
    void retranslateUi();
    bool load(const QString &fn);
    bool maybeSave();
    void setFileName(const QString &fn);
};

#endif // MAINWINDOW_H
